package mirrormonkey.state.member.accessor;

import java.lang.reflect.Field;

import mirrormonkey.framework.entity.SyncEntity;

public class FieldReadAccessor implements ValueReadAccessor {

	public final Field field;

	public FieldReadAccessor(Field field) {
		this.field = field;
	}

	@Override
	public Object readValue(SyncEntity entity) {
		try {
			return field.get(entity);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}

}
